package com.vic.generics.b;

/**
 * @author victor
 */
public class Testc<T> {

    private Class<T> t;

    public Testc(Class<T> t) {
        this.t = t;
    }

    public boolean compare(Object obj) {
        return t.isInstance(obj);
    }

    public static void main(String[] args) {
        Testc<A> aTestc = new Testc<>(A.class);
        System.out.println(aTestc.compare(new A())); // true
        System.out.println(aTestc.compare(new B())); // true
    }

}

class A {}
class B extends A {}
